import { reqFloors } from "@/api";

const state = {
    floors: [],
};

const getters = {};

const mutations = {
    // 获取楼层轮播
    GET_FLOORS(state, { floors }) {
        state.floors = floors;
    },
};

const actions = {
    // 获取三级列表
    getFloors({ commit }) {
        reqFloors().then(response => {
            commit("GET_FLOORS", { floors: response });
        });
    },
};

export default {
    namespaced: true, // 开启命名空间
    state,
    getters,
    mutations,
    actions,
};
